package cn.itcast.leyou.controller;

import cn.itcast.leyou.pojo.User;
import cn.itcast.leyou.service.Impl.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Author: Saka
 * Date: 2019/1/6
 * Time: 18:58
 */
@RestController
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("user/{id}")
    public User queryById(@PathVariable("id")Long id) {
        return userService.queryById(id);

    }

    @PostMapping("userdelete/{id}")
    public void deleteById(@PathVariable("id") Long id) {
        userService.deleteById(id);
    }
}
